<template>
    <div class="goods-edit-container">
        <GoodsForm @submit="handle_edit" btn_text="修改" />
    </div>
</template>

<script>
import GoodsForm from "@/components/GoodsForm"
import { edit_product } from "@/api"

export default {
    components: {
        GoodsForm
    },
    methods: {
        handle_edit(data) {
            edit_product(data).then(() => {
                this.$message({
                    message: "修改成功",
                    type: "success"
                })
                this.$router.go(-1)
            })
        }
    }
}
</script>

<style lang="less">
.goods-edit-container {
    .goods-form-container {
        margin-top: 20px;
    }
}
</style>
